

import bpy
import nodeitems_utils
from bpy.types import Operator, Menu










class C_节点子菜单_数学运算(Menu):
	bl_idname = "node.math_operation"
	bl_label = "数学运算"

	def draw(self, context):
		layout = self.layout
		#layout.operator('node.global_node_operation_f_c_f')
		#layout.operator('node.global_node_operation_i_c_i')
		layout.operator('node.global_node_if')


		#new
		layout.separator()
		layout.operator('node.global_add_scalar_operation_node', icon='IPO_SINE')
		layout.operator('node.create_node_scalar_bit_operation')
		layout.operator('node.calculation_vec3', icon='IPO_CUBIC')

		layout.separator()
		layout.operator('node.vec4_element_assignment', text='矢量赋值')
		

		layout.separator()
		layout.operator('node.global_add_materixff_c_vect_operation')
		layout.operator('node.global_add_materixff_c_vecf_operation')
		

		#关系逻辑运算
		layout.separator()
		layout.operator('node.create_node_scalar_relationship_operation')
		
		layout.separator()
		layout.operator('node.add_bvh_node', icon='VIEW_ORTHO')
		

		#统计
		layout.separator()
		layout.operator('node.global_node_f32_a2_total')



class C_节点子菜单_转换(Menu):
	bl_idname = "node.math_conversion"
	bl_label = "数学转换"
	
	def draw(self, context):
		layout = self.layout
		layout.operator('node.global_node_swparate_xyz', icon='RESTRICT_INSTANCED_ON')
		layout.operator('node.global_node_merge_xyz', icon='RESTRICT_INSTANCED_ON')
		layout.operator('node.global_node_swparate_uvec_uuu')
		layout.operator('node.global_node_merge_uvec_uuu')
		
		layout.separator()
		layout.operator('node.global_node_swparate_vec4')
		layout.operator('node.global_node_merge_vec4')

		layout.separator()
		layout.operator('node.global_node_swparate_element_matrix_3x3', icon='RESTRICT_INSTANCED_ON')
		layout.operator('node.global_node_merge_element_matrix_3x3', icon='RESTRICT_INSTANCED_ON')
		
		layout.separator()
		layout.operator('node.create_node_vec_fff_array_i_merge')
		layout.operator('node.create_node_vec_iii_array_i_merge')



class C_节点子菜单_控制(Menu):
	bl_idname = "node.node_control"
	bl_label = "包"

	def draw(self, context):
		layout = self.layout

		layout.operator('node.global_node_fun', icon='CON_TRANSFORM')
		layout.operator('node.global_node_loop', icon='FILE_REFRESH')

		#函数和循环实例
		#NODETREE 
		layout.separator()
		layout.label(text="函数")

		layout.separator()
		layout.label(text="循环")



class C_节点子菜单_数学函数(Menu):
	bl_idname = "node.math_fun"
	bl_label = "数学函数"

	def draw(self, context):
		layout = self.layout
		layout.operator('node.global_node_exponent')
		layout.operator('node.global_node_pythagorean')
		layout.operator('node.global_node_p1_publicfunction')
		layout.operator('node.global_node_mathutils_vector')
		
		#new
		layout.operator('node.function_calculation_step', icon='IPO_CONSTANT')




class C_计算节点子菜单_几何计算(Menu):
	bl_idname = "node.math_geometric_calculation"
	bl_label = "几何计算"

	def draw(self, context):
		layout = self.layout
		layout.operator('node.calculation_coordinate_boundingbox', icon='LIGHTPROBE_CUBEMAP')





classes = (
	C_节点子菜单_数学运算,
	C_节点子菜单_转换,
	C_节点子菜单_数学函数,
	C_节点子菜单_控制,

	C_计算节点子菜单_几何计算,
)

def register():
	for c in classes:
		bpy.utils.register_class(c)

def unregister():
	for c in classes:
		bpy.utils.unregister_class(c)

	



